﻿using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections;
using umbraco.DataLayer;
using umbraco.BusinessLogic;
using umbraco.editorControls;
using System.Collections.Generic;
using System.Data.SqlClient;
using umbraco.NodeFactory;
using System.Web.SessionState;
using umbraco.BusinessLogic.Actions;
using umbraco.cms.businesslogic.web;
using umbraco.cms.businesslogic.property;
using umbraco.interfaces;
using ExtendedWorkFlow.Helpers;
using ExtendedWorkFlow.Commands;

namespace ExtendedWorkFlow
{

    public class State : Node
    {

        #region Variables

        bool _IsCompleted = false;

        #endregion

        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="GroupId">GroupId of WorkFlow</param>                
        public State(int StateId)
            : base(StateId)
        {
            if (this.Properties["isCompleted"] != null)
                this._IsCompleted = Functions.ToBool(this.Properties["isCompleted"].Value);
        }

        #endregion

        #region Properties

        /// <summary>
        /// Flag to indicate if the workflow finishs on this state
        /// </summary>
        public bool IsCompleted { get { return this._IsCompleted; } }

        /// <summary>
        ///  Get the base node
        /// </summary>
        public Node Node { get { return this as Node; } }

        #endregion

    }

}